<link type="text/css" rel="stylesheet" href="css/ui/Calendar.css" media="screen" />
<link type="text/css" rel="stylesheet" href="css/productOrder.css" media="screen" />
<div class="clay"> 
		<input type="hidden" id="remaindMoney" value="<?=$v['money']?>"/>
		<input type="hidden" id="remainTmoney" value="<?=$v['tmoney']?>"/>
		<input type="hidden" id="minbuytnum" value="<?=$p_info['buy_limit_low']?>"/>
		<input type="hidden" id="pay" value="<?=$p_info['pay']?>"/>
		<input type="hidden" id="tourist_info" value="<?=$land_f_info['tourist_info']?>"/>
        <?if($_GET['a']):?>
		<form action="formSale_dt.php" method="post" name="group">
        <?else:?>
        <form action="formSale.php" method="post" name="group">
        <?endif;?>
			<input type="hidden" name="pid" id="pid" value="<?=$pid?>"/>
			<input type="hidden" name="did" id="did" value="<?=$fid?>"/>
			<input type="hidden" name="aid" id="aid" value="<?=$_REQUEST['aid']?>"/>
			<h2><a target="_blank" href="scenicDetail.html?lid=<?=$p_info['lid']?>&did=<?=$fid?>">[<?=$ptypes[$p_info['p_type']]?>]<?=$p_info['ltitle']?></a></h2>
			<div class="proBd">
				<div class="contactW ">
					<h3 class="title">
						<span class="title">预订信息</span>
					</h3>
					<div class="box">
						<div class="ticketlist">
							<?if($p_info['p_type']=="C"){$leavetime=date("Y-m-d",strtotime($begintime)+24*3600);?>
								<p class="roomType line">
									<span class="lTitle">房间类型：</span>
									<?=$p_info['ttitle']?>
								</p>
								<p class="rooms line">
									<span class="lTitle"><i class="red">*</i>预订间数：</span>
									<select id="roomNum" name="tnum">
										<?for($j=$buynum;$j<=20;$j++){?>
										<option value="<?=$j?>"><?=$j?>间</option>
										<?}?>
									</select>
								</p>
								<p class="playtime line">
									<span class="lTitle"><i class="red">*</i>入住日期：</span>
									<input type="text" name="begintime" id="begintime" class="inputText" value="<?=$begintime?>"/>
									<span class="lTitle"><i class="red">*</i>离店日期：</span>
									<input type="text" name="leavetime" id="leavetime" class="inputText" value="<?=$leavetime?>"/>
								</p>
								<ul class="priceItem">
									<li style="display:none">
										<input type="hidden" value="<?=$uprice?>"/>
										<div class="priItem">
											<span>¥<?=$uprice?></span>
											<input type="hidden" class="tnum" value="<?=$buynum?>"/>
										</div>
									</li>
								</ul>
							<?}else{?>
								<p class="playtime line">
									<?if($p_info['p_type']=="A"||$p_info['p_type']=="B"||$p_info['p_type']=="F"){?>
									<span class="lTitle"><i class="red">*</i>游玩日期：</span>
									<input type="text" name="begintime" id="begintime" class="inputText" value="<?=$begintime?>"/>
									(<?=$timeTitle?>)
									<?}elseif($p_info['p_type']=="D"){?>
									<input type="hidden" name="begintime" id="begintime" class="inputText"  value="<?=$begintime?>"/>
									<?}?>
								</p>
								<table class="listCon proTable type<?=$p_info['p_type']?>" style="width:100%;">
									<thead>
										<tr>
											<th class="list_1">产品名称</th>
											<th>产品库存</th>
											<th class="price">门市价</th>
											<th class="price">零售价</th>
											<th>预订数量</th>
											<th>小计</th>
										</tr>
									</thead>
									<tbody>
										<?foreach($products as $row){?>
										<tr class="line <?=++$pn>3?"more display_none":""?>">
											<td class="list_1 list"><?=$row['ttitle']?></td>
											<td><em class="storage_<?=$row['pid']?>">--</em></td>
											<td class="list_2 list"><em class="price">¥<?=(int)$row['tprice']?></em></td>
											<td class="list_2 list"><em class="price jprice uprice_<?=$row['pid']?>">¥<?=$row['uprice']/100?></em></td>
											<td class="list_4 list">
												<input type="hidden" class="tprice_<?=$row['pid']?>" value="<?=$row['uprice']/100?>"/>
												<div class="jiajian">
													<a href="#" class="jian jjBtn J_jianBtn minus">减一张</a>
													<input type="text" id="<?=$row['id']?>" name="<?=$row['name']?>" value="<?=$row['buynum']?>" p_minTime="<?=$row['minTime']?>" p_minbuy="<?=$row['buy_limit_low']?>" class="input_text tnum">
													<a href="#" class="jia jjBtn J_jiaBtn add">加一张</a>
												</div>
											</td>
											<td class="list_6 list totalprice">¥<em class="subtotal"><?=$row['buynum']*$row['uprice']/100?></em></td>
										</tr>
										<?}?>
									</tbody>
								</table>
								<?if(count($products)>3){?>
								<p class="addTicket">
									<a class="fr show_more">显示所有门票类型</a>
								</p>
								<?}?>
							<?}?>
						</div>
						<div class="clear"></div>
						<?if($ass_station=unserialize($land_f_info['ass_station'])){?>
						<p class="line">
							<span class="lTitle"><i class="red">*</i>集合地址：</span>
							<select name="assembly">
							<?foreach($ass_station as $key=>$station){?>
							<option value="<?=$key?>"><?=$station?></option>
							<?}?>
							</select>
						</p>
						<?}?>
					</div>
				</div>
				<div class="border_line"></div>
				<div class="contactW ">
					<h3 class="title">
						<span class="title">联系人信息</span>（请准确填写联系人信息，我们将向联系人手机发送订单短信）
						<!-- <span class="save"><input type="checkbox" value="1" name="saveTo" class="inputText"/>保存到常用联系人</span> -->
					</h3>
					<div class="box">
						<p class="line">
							<span class="lTitle"><i class="red">*</i>联系人：</span>
							<input type="text" class="inputText" id="ordername" autocomplete="off" name="ordername"/>
						</p>
						<p class="line">
							<span class="lTitle"><i class="red">*</i>手机号码：</span>
							<input type="hidden"  class="inputText" id="ordertel" name="ordertel" value="<?=$m_info['account']?>">
							<!-- <input type="text"  class="inputText" id="ordertel" name="ordertel" value=""> -->
							<span><?=$m_info['account']?></span>
							(接收订单短信)
						</p>
						<?if($m_info['cname']&&$m_info['ctel']){
							$cname=explode("|",$m_info['cname']);
							$ctel=explode("|",$m_info['ctel']);
						?>
						<div class="contactWrap" id="contactWrap">
							<div class="content">
								<a class="closebtn"></a>
								<h4>您可以选择以下常用联系人：</h4>
								<ul>
								<?for($i=count($cname)-1;$i>=0;$i--){
									if(!$cname[$i]) continue;
								?>
									<li>
										<input type="checkbox" value="<?=$ctel[$i]?>" />
										<span class="name"><?=$cname[$i]?></span>
									</li>
								<?}?>
								</ul>
								<p class="clear">&nbsp;</p>
							</div>
						</div>
						<?}?>
						<?if($p_info['ifs']==1){?>
						<p class="line">
							<span class="lTitle">取票方式：</span>
							<input type="radio" checked name="getTicket" class="getTicket" value="0"/><label>游客自取</label>
							<input type="radio" name="getTicket" class="getTicket" value="1"/><label>快递送票</label>
						</p>
						<p class="line postAddress display_none">
							<span class="lTitle"><i class="red">*</i>邮寄地址：</span>
							<input type="text" id="postAddress"  class="inputText postAddress"/>(请正确填写邮寄地址)
						</p>
						<p class="line postCode display_none">
							<span class="lTitle"><i class="red">*</i>邮政编码：</span>
							<input type="text" id="postCode" class="inputText"/>
						</p>
						<?}?>
					</div>
				</div>
				<?if($land_f_info['p_type']=='C'){?>
				<div class="border_line"></div>
				<div class="guest">
					<h3 class="title"><span class="title">入住信息</span></h3>
					<div class="box roomInfo">
						<?if($land_f_info['tourist_info']>0){?>
						<p class="line">
							<span class="lTitle"><i class="red">*</i>入住人姓名：</span>
							<span class="roomDiv">
								<input type="text" class="inputText roomer gray" id="roomer" name="tourist_name_1" value="入住人1"/>
								<span class="ts">(请填写实际入住人姓名，每个房间只需填1位)</span>
							</span>
						</p>
						<?}?>
						<div class="clear"></div>
						<p class="arriveTime line">
							<span class="lTitle"><i class="red">*</i>最晚到店：</span>
							<select class="" name="arriveTime" id="arriveTime">
								<option value="">请选择时间</option>
								<option>15:00</option>
								<option>16:00</option>
								<option>17:00</option>
								<option>18:00</option>
								<option>19:00</option>
								<option>20:00</option>
								<option>21:00</option>
								<option>22:00</option>
								<option>23:00</option>
								<option>24:00</option>
								<option>次日1:00</option>
								<option>次日2:00</option>
								<option>次日3:00</option>
								<option>次日4:00</option>
								<option>次日5:00</option>
							</select>
						</p>
					</div>
				</div>
				<?}elseif($land_f_info['tourist_info']>0){?>
				<div class="border_line"></div>
				<div class="contactW ">
					<h3 class="title"><span class="title">旅客信息</span>（儿童证件号码请填写出生日期）</h3>
					<div class="box tourist">
						<?if($land_f_info['tourist_info']==1){?>
						<div class="info">
							<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
							<span>
								<select class="tourist_type" style="display:none">
									<option value="1">成人</option>
								</select>
							</span>
							<span>
								<label class="lt"><i class="red">*</i>姓名:</label>
								<input type="text" name="tourist_name_1" class="tourist_name">
							</span>
							<span>
								<label class="lt"><i class="red">*</i>身份证号:</label>
								<input type="text" name="tourist_cert_1" class="tourist_cert" >
							</span>
						</div>
						<?}else{
						for($i=1;$i<=$buynum;$i++){?>
						<div class="info">
							<span>第<?=$i?>位游客</span>
							<span>
								<select class="tourist_type">
									<option value="1">成人</option>
									<option value="0">儿童</option>
								</select>
							</span>
							<span>
								<label class="lt"><i class="red">*</i>姓名:</label>
								<input type="text" name="tourist_name_<?=$i?>" class="tourist_name">
							</span>
							<span>
								<label class="lt"><i class="red">*</i>身份证号:</label>
								<input type="text" name="tourist_cert_<?=$i?>" class="tourist_cert" >
							</span>
						</div>
						<?}
						}?>
					</div>
				</div>				
				<?}?>
				
				<?if($lid==406){?>
				<div class="border_line"></div>
				<div class="contactW ">
					<h3 class="title"><span class="title">备注信息</span>（如无需要，可不填写）</h3>
					<div class="box">
						<p class="line">
							<input type="hidden" id="origin" name="origin" value="中国"/>
							<span class="lTitle fL">客源地：</span>
							<span class="rightText">
								<select name="d_state" id="d_state">
								<?foreach($stateData as $index=>$state){?>
								<option value="<?=$index?>"><?=$state[0]?></option>
								<?}?>
								</select>
								<span id="area"></span>
							</span>
						</p>
						<p class="line">
							<span class="lTitle fL">订单备注：</span>
							<textarea class="memo" name="memo"></textarea>
						</p>
					</div>
				</div>
				<?}?>
				
				<?if($p_info['pay']==0){?>
				<div class="border_line"></div>
				<div class="contactW ">
					<h3 class="title"><span class="title">预订说明</span></h3>
					<div class="box">
						<p class="line">
							<em class="red">游客现场消费时按零售价支付；游客消费后 ，分销佣金（销售价-结算价）将自动结算到“帐户余额”中</em>
						</p>
					</div>
				</div>
				<?}?>
				
				<?if($p_info['pay']==3){?>
				<div class="border_line"></div>
				<div class="contactW ">
					<h3 class="title"><span class="title">预订说明</span></h3>
					<div class="box">
						<p class="line">
							<em class="red">订单提交后，需等待供应商确认，并在供应商订单确认后1小时内完成订单才生效 </em>
						</p>
					</div>
				</div>
				<input type="hidden" value="<?=$confirm_paymode[$paySelect]?>" name="paymode"/>
				<?}else{?>
				<div class="border_line"></div>
				<div class="contactW ">
					<h3 class="title"><span class="title">支付方式</span></h3>
					<div class="box">
						<p class="line pmodel" style="padding-left:20px;">
							<!--<input class="paymode" type="checkbox" value="0" name="paymode">
							<span>账户余额<label> (可用<em class="money">¥<?=$v['money']?></em>)</label></span>
							</br> -->
							<input class="paymode" type="radio" value="1" name="paymode" checked="checked">
							<span>支付宝</span>
						</p>
					</div>
				</div>
				<?}?>
			</div>
			<div class="totalCount">
				<p class="con"> 
					<a href="#" class="submitBtn"></a>
					<i class="icon"></i>
					<?if($p_info['p_type']!="C"){?>
					<span class="span1">门票数：<em id="sumtnum" class="num"><?=$buynum?></em>张</span>
					<?}?>
					<span class="span2">总金额：<em id="summoney" class="num"><?=$buynum*$uprice/100?></em>元</span>
				</p>
			</div>
			<div class="about">
				<h3>购票需知：</h3>
				<?=nl2br($p_info['jqts'])?>
				<h3>产品说明：</h3>
				<?=$tips?>
				<h3>取票信息：</h3>
				<?=$p_info['getaddr']?>
			</div>
		</form>
	</div>
</div>
<script type="text/html" id="tourist_tmpl">
	<div class="info">
		<span>第{:num}位游客</span>
		<span>
			<select class="tourist_type">
				<option value="1">成人</option>
				<option value="0">儿童</option>
			</select>
		</span>
		<span>
			<label class="lt"><i class="red">*</i>姓名:</label>
			<input type="text" name="tourist_name_{:num}" class="tourist_name">
		</span>
		<span>
			<label class="lt"><i class="red">*</i>身份证号:</label>
			<input type="text" name="tourist_cert_{:num}" class="tourist_cert" >
		</span>
	</div>
</script>
<script type="text/html" id="pri_tmpl">
	<li>
		<div class='title'> {:date}({:weekT})</div>
		<input type="hidden" value="{:jsprice}"/>
		<div class="priItem">
			<span>¥{:jsprice}</span></br>
			<span>{:roomStatus}</span>
			<input type="hidden" class="tnum" value="{:tnum}"/>
		</div>
	</li>
</script>
<script type="text/html" id="roomer_tmpl">
	<input type="text" class="inputText roomer more gray" name="tourist_name_{:i}" value="入住人{:i}"/>
</script>
<script type="text/javascript" src="js/jquery.getareas.js" type="text/javascript"></script>
<script type="text/javascript" src="js/global/Date_func.js"></script>
<script type="text/javascript" src="js/ui/JsTpl.js"></script>
<script type="text/javascript" src="js/ui/PopWindow.js"></script>
<script type="text/javascript" src="js/form/Verify.js"></script>
<?if($p_info['p_type']=="C"){?>
	<script type="text/javascript" src="js/ui/Calendar_hotel.js"></script>
<?}else{?>
	<script type="text/javascript" src="js/ui/Calendar.js"></script>
<?}?>
<script type="text/javascript" src="js/productOrder.js"></script>